package com.aspose.cells.b.a.b.d.a;

import com.aspose.cells.a.c.zn;
import com.aspose.cells.a.d.zfq;
import com.aspose.cells.b.a.b.zg;
import java.awt.Graphics2D;

public class zc {
   private float a;
   private zd b;
   private final String c;
   private final zg d;
   private zfq e;

   public zc(zd var1, float var2, String var3, zg var4) {
      this.b = var1;
      this.a = var2;
      this.c = var3;
      this.d = var4;
      this.e = var1.c();
   }

   public final float a() {
      return this.a;
   }

   public final float b() {
      return this.i() + this.b.h() * 2.0F;
   }

   public final int c() {
      return this.c.length();
   }

   public final float d() {
      try {
         return (float)this.b.b().getAscent();
      } catch (Exception var2) {
         return (float)this.d.b().c(this.d.k()) * (float)this.d.d() / (float)this.d.b().e(this.d.k());
      }
   }

   public final float e() {
      try {
         return (float)this.b.b().getDescent();
      } catch (Exception var2) {
         return (float)this.d.b().d(this.d.k()) * (float)this.d.d() / (float)this.d.b().e(this.d.k());
      }
   }

   public final float f() {
      try {
         return (float)this.b.b().getLeading();
      } catch (Exception var2) {
         return (float)this.e.j() * this.d.h() / (float)this.e.y();
      }
   }

   public final float g() {
      if (this.b.g().f()) {
         float var1 = this.b.f();
         if (Float.isInfinite(var1) && var1 > 0.0F) {
            var1 = 0.0F;
         }

         switch(this.b.g().a()) {
         case 1:
            return (var1 - this.i()) / 2.0F;
         case 2:
            return var1 - this.i() - this.j();
         default:
            return this.j();
         }
      } else {
         return this.a() + this.d();
      }
   }

   public final float h() {
      float var1 = this.b.e();
      if (Float.isInfinite(var1) && var1 > 0.0F) {
         var1 = 0.0F;
      }

      if (this.b.g().f()) {
         return this.b.g().g() ? var1 - this.a() - this.d() : this.a() + this.f() + this.e();
      } else {
         float var2;
         switch(this.b.g().a()) {
         case 1:
            var2 = (var1 - this.i()) / 2.0F;
            break;
         case 2:
            if (this.b.g().g()) {
               var2 = this.j() / 2.0F;
            } else {
               var2 = var1 - this.i() - this.j() / 2.0F;
            }
            break;
         default:
            if (this.b.g().g()) {
               var2 = var1 - this.i() - this.j() / 2.0F;
            } else {
               var2 = this.j() / 2.0F;
            }
         }

         return var2;
      }
   }

   public final float i() {
      float var1 = zn.b(this.b.b(), this.e, this.c, this.d.g(), this.d.h(), this.d.k());
      return var1;
   }

   public float j() {
      return this.b.a(this.i()) - this.i();
   }

   public void a(Graphics2D var1, float var2, float var3) {
      if (this.b.g().f()) {
         var1.drawString(this.c, var3 + this.g(), -(var2 + this.h()));
      } else {
         var1.drawString(this.c, var2 + this.h(), var3 + this.g());
      }

   }

   public String k() {
      return this.c;
   }
}
